<template>
  <div style=" text-align: right;">
    <el-pagination
      @size-change="limitChange"
      @current-change="startChange"
      :current-page="queryParams.pageNum"
      :page-sizes="[10, 20, 30, 40, 50]"
      :page-size="queryParams.pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total">
    </el-pagination>
  </div>
</template>

<script>
export default {
  data() {
    return {
      pagination: { //翻页配置
        limit: 20, //   每页显示的条数
        start: 0, // 开始页
      },
      queryParams: { //翻页配置
        pageNum: 1, //  
        pageSize: 20, // 
      },
    }
  },
  props: {
    total: {
      type: Number,
      default: 0
    },
  },
  mounted() {
    this.getListData()
  },
  computed: {

  },
  methods: {
    //处理查看附件按钮事件
    getListData() {
      this.$emit('fun', this.pagination);
    },
    limitChange(e) {
      this.queryParams.pageSize = e;
      this.pagination.limit = e;
      this.getListData();
    },
    startChange(e) {
      this.queryParams.pageNum = e;
      this.pagination.start = (this.queryParams.pageNum - 1) * this.queryParams.pageSize;
      this.getListData();
    },
  }
};
</script>

<style scoped>

</style>